<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>

<%
	request.setAttribute("title","用户详情");
	request.setAttribute("modelConfigPath", "official");
%>
<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>
<style type="text/css">
 .content{
     margin-bottom: 24px;
  }
</style>


<t:panel cssClass="panel-flat form-detailed" customBody="true" customHead="true">
	<div class="detailed-navbar-content panel-body content">
		<t:form commandName="articalClassify" action="/admin/official/articalClassify/save" method="post" cssClass="form-horizontal">
			<div class="hide">
				<t:hidden path="id"/>
				<t:hidden path="deleteMark"/>
				<t:input type="hidden" path="imgURL" />  
			</div>
			<t:formgroup>
				<t:label path="name" cssClass="col-sm-2" />
				<t:input path="name"  colClass="col-sm-4" />
				<t:label path="title" cssClass="col-sm-2" />
				<t:input path="title" data-valcopy-for="name" colClass="col-sm-4" />
			</t:formgroup>
			<t:formgroup>
				<t:label path="parentId"  cssClass="col-sm-2"  />
				<t:treelist path="parentId"  colClass="col-sm-4"  />
				<t:label path="sortCode" cssClass="col-sm-2" />
				<t:input path="sortCode" tsStep="10" touchspin="true" colClass="col-sm-4" />
			</t:formgroup>
			<t:formgroup>
				<t:label path="type" cssClass="col-sm-2" />
				<t:select2 path="type" colClass="col-sm-4" />
				<t:label path="hidden" cssClass="col-sm-2" />
				<t:switch path="hidden" colClass="col-sm-4" offColor="primary" onColor="danger"></t:switch>
			</t:formgroup>
			<t:formgroup>
				<t:label path="functionURL" cssClass="col-sm-2" />
				<t:input path="functionURL" colClass="col-sm-4" />
			</t:formgroup>
			<t:formgroup>
                <div class="col-sm-6">
                <t:label path="imgURL" cssClass="col-sm-4" /> 
                <div class="col-sm-4">  
               		<c:if test="${articalClassify.imgURL!=null && articalClassify.imgURL!=''}">
					    <img style="width:100px; height:80px;" id="smallPicShow" src="${tfn:getFileUrl(articalClassify.imgURL)}" /> 
				    </c:if>
				    <c:if test="${articalClassify.imgURL ==null || articalClassify.imgURL==''}">
						 <img style="width:100px; height:80px;" id="smallPicShow" src="<c:url value='/images/we/invitationIndex/bg1.jpg' />" />
				    </c:if>
				    </div>
				    <div class="col-sm-4">
				    <label>加载进度</label>
                      <div style="width:100px;height: 10px;margin-top:0.5rem; border: 2px solid #afafaf;border-radius:15px;"class="smallParent">
        			    <div style="width:0px;height: 7px;background-color: #afafaf" class="smallProgress"></div>
        		      </div>
					<button type="button" class="btn-info" id="deleteSmallPic" style="padding-left:10px;border-radius:6px; margin-top:1rem">删除图片</button>
                    </div>
                </div> 
            </t:formgroup>
			<t:formgroup>
				<t:label path="keyword" cssClass="col-sm-2" />
				<t:textarea path="keyword" rows="4" colClass="col-sm-10" />
			</t:formgroup>
			<t:formgroup>
				<t:label path="remark" cssClass="col-sm-2" />
				<t:textarea path="remark" rows="4" colClass="col-sm-10" />
			</t:formgroup>
		</t:form>
	</div>
	<div class="navbar-fixed-bottom">
	<t:panelFoot>
		<c:if test="${t_mode ne 3}">
			<t:button icon="icon-floppy-disk" onclick="saveData()" cssClass="btn-info" csize="sm">保存</t:button>
		</c:if>
	</t:panelFoot>
	</div>
</t:panel>
<script type="text/javascript">
	function saveData(){
		if (!$("form:first").valid()){
			return;
		}
		$("form:first").submit();
	}	
	
	function actionResultCallBack(){
		var baseOperate={close:true,refresh:false}
		top.main.reloadTree();
		return baseOperate;
	}
	
	$(function(){
		$("#smallPicShow").on('click',function(e) {
			$(".smallProgress").width(0);
			$("#imgURL").startCosFileUpload({
				fillImg:"#smallPicShow",
				progressCallback:function(curr, sha1){
					$(".smallParent").show();
					$(".smallProgress").width(0);
					$(".smallProgress").width(sha1*96);
				}
			});
		});
	});	
	
	$(function(){
		$("#deleteSmallPic").on('click',function(e){
			$(".smallProgress").width(0);
			$("#smallPicShow").attr("src",$.getVirtualPath()+"/images/we/invitationIndex/bg1.jpg");
			$("#imgURL").val("");
			console.log(result);
		});
	});
</script>
<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formselects.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formselectbox.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formstyling.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/forminputs.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/ztree.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/dialog.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/tools/upload-cos.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/contentFooter.jsp"%>
